﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SdlDotNet.Graphics;
using SdlDotNet.Graphics.Sprites;
using System.IO;
using Pokemon;
using Color = System.Drawing.Color;

namespace MapEditor
{
    class Global
    {
        public static Random Random = new Random();
        public static Surface MainSurface;
        public static SurfaceCollection Tileset= new SurfaceCollection();
        public static List<Map> Everything = new List<Map>();
        public static Font Font;

        public static void Init()//TODO
        {
            LoadGFX();
            LoadContent();
        }

        public static void LoadContent()//TODO
        {

        }

        public static void LoadGFX()//TODO
        {
            Global.Font = new Font(@"Content/GFX/Arial.ttf", 16);

            try
            {
                foreach (string file in Directory.GetFiles(@"Content/GFX/Tilesets"))
                {
                    try
                    {
                        Tileset.Add(file, new System.Drawing.Size(16, 16));
                    }
                    catch (Exception e)
                    {
                        //Logfile Entry
                    }
                }
            }
            catch
            { 
                //Critical, couldn't find directory or similar.
            }

            Tileset.Transparent = true;
            Tileset.TransparentColor = Color.FromArgb(255, 0, 255);
            Tileset.AlphaBlending = true;
        }
    }
}
